var chave : boolean;
var boss_script : boss;
var escada : boolean;
var fisica : Teste;
var particula : GameObject;
function FixedUpdate () {

		
	if(escada)
	{
		if(Input.GetKey("w")|| Input.GetKey(KeyCode.UpArrow))
		{
			fisica.enabled = false;
			rigidbody.useGravity = false;
			transform.Translate(0,0.1,0);
		}
		else
		{
			fisica.enabled = true;
		}
		
	}
	
}

function OnTriggerEnter (arroz:Collider)
{
	if(arroz.gameObject.name == "pedras_matam")
	{
		
		Destroy(gameObject);
		Application.LoadLevel(Application.loadedLevel);
	}
	
	if(arroz.gameObject.name == "porta")
	{
		if(chave)
		{
			Destroy(arroz.gameObject);
		}
	}
}

function OnTriggerStay (colidi:Collider)
{
	if(colidi.gameObject.tag == "escada")
	{
		escada = true;
	}
}
function OnTriggerExit (colidiu : Collider)
{
	if(colidiu.gameObject.tag == "escada")
	{
		escada = false;
		rigidbody.useGravity = true;
		
	}
}